<template>
  <view class="pay-success-container" v-if="m_isLoaded">
    <view>
      <!-- <view > -->
      <view class="text"
        >支付成功!
        <!-- ￥{{ m_Order.FRealAmount.toFixed(2) || 0 }} --></view
      >
      <!--       <view
        style="
          text-align: center;
          margin-top: 10rpx;
          color: #999999;
          font-size: 24rpx;
        "
        >{{ m_Order.FPayDate || 0 }}</view
      > -->
    </view>
    <view class="back-btn">
      <button
        type="primary"
        style="background-color: #fe0203; color: #fff"
        @click="goOrder"
      >
        返回订单
      </button>
    </view>
  </view>
</template>

<script>
import { reqPost } from "../../../common/http.request";
import { uRedirectTo } from "../../../utils/uniUtils";

export default {
  name: "pay_success",
  data() {
    return {
      payInfo: {},
      m_Order: {},
      m_Goods: {},
      m_isLoaded: false,
    };
  },
  async onLoad({ orderId }) {
    if (orderId) {
      await this.getPageData(orderId);
    }
  },
  methods: {
    async getPageData(orderId) {
      const { Order, Goods } = (
        await reqPost("OrderDetail", {
          orderId,
        })
      ).Data;
      this.m_Order = Order[0];
      this.m_Goods = Goods;
      this.m_isLoaded = true;
    },
    goOrder() {
      uRedirectTo("/pages/order/OrderList?l=0");
    },
  },
};
</script>

<style lang="scss">
view {
  box-sizing: border-box;
}

.pay-success-container {
  .text {
    font-size: 40rpx;
    color: #333;
    text-align: center;
    padding-top: 50rpx;
  }

  .back-btn {
    width: 50%;
    margin: 40rpx auto;
  }
}
</style>
